<?php
class Account extends CI_Controller
{
	public function __construct()
	{
		parent::__construct();

		// load helper
		$this->load->helper('url');

		$this->load->model("User_model", '', TRUE);
		$this->load->library('session');

	}

	public function index()
	{

		$this->load->view('account/index');		
	}

	public function login_post()
	{
		if($this->User_model->Login()){
			redirect("/home/index");
		}else{
			redirect("/account/index");
		}		
	}	

	public function register()
	{
		$this->load->view('account/login');
	}

	public function register_post()
	{
		$companyId = 1;
		$this->User_model->Register($companyId);
		redirect("/home/index");
	}
}
?>